import { request } from "@/utils/service"
import type * as Pipeline from "./types/pipeline"

/** 增 */
export function createAdminDataApi(data: Pipeline.CreateOrUpdatePipelineRequestData) {
  return request({
    url: "admin",
    method: "post",
    data
  })
}

/** 删 */
export function deleteAdminDataApi(ids: string) {
  return request({
    url: `admin/batch?ids=${ids}`,
    method: "delete"
  })
}

// /** 改 */
export function updateAdminDataApi(data: Pipeline.CreateOrUpdatePipelineRequestData) {
  return request({
    url: "admin",
    method: "put",
    data
  })
}

/** 查 */
export function getAdminDataApi(params: Pipeline.GetPipelineRequestData) {
  return request<Pipeline.GetPipelineResponseData>({
    url: "admin",
    method: "get",
    params
  })
}
